import { IMessageBase } from "../../Framework/MQ/IMessageBase";
import { MessageManager } from "../../Framework/MQ/MessageManager";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { DictIntStrHelper } from "../Public/DictIntStrHelper";
import { SeqSPetInfoHelper } from "./SeqSPetInfoHelper";
import { SEntityId } from "../Public/SEntityId";
type int = number;
//class SPetBag
    
    export  class SPetBag extends IMessageBase
    {
        constructor(arg1: Boolean=false)
        {
            
            super();if (arg1) 
            {
                MessageManager.instance().regist(this);
            }
            return;
        }

        public /* override */ getType(): int
        {
            return this._type;
        }

        public /* override */ clone(): IMessageBase
        {
            return new SPetBag();
        }

        public /* override */ __write(arg1: SerializeStream): void
        {
            this.entityId.__write(arg1);
            arg1.writeInt(this.posType);
            arg1.writeInt(this.capacity);
            DictIntStrHelper.write(arg1, this.dictIntStr);
            SeqSPetInfoHelper.write(arg1, this.petInfos);
            return;
        }

        public /* override */ __read(arg1: SerializeStream): void
        {
            this.entityId = new SEntityId();
            this.entityId.__read(arg1);
            this.posType = arg1.readInt();
            this.capacity = arg1.readInt();
            this.dictIntStr = DictIntStrHelper.read(arg1);
            this.petInfos = SeqSPetInfoHelper.read(arg1);
            return;
        }

        public /* const */_type: int=12024;

        public /* var */entityId: SEntityId;

        public /* var */posType: int;

        public /* var */capacity: int;

        public /* var */dictIntStr: Map<any, any> /* flash.utils.Dictionary */;

        public /* var */petInfos: Array<any>;

        public static /* var */_regist: SPetBag;
    }

            SPetBag._regist = new SPetBag(true);
        